#region Using
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
#endregion Using

namespace CY.GFive.Core.Business
{
	public class Vote : Business.BusinessBase<Vote, int>
	{
		#region Fields and Properties

		private int voteSate = 0;
		/// <summary>
		/// 
		/// </summary>
		public int VoteSate
		{
			get { return voteSate; }
			set
			{
				if (value != voteSate)
				{
					MarkChanged("VoteSate");
					voteSate = value;
				}
			}
		}

		private int voteLimit = 0;
		/// <summary>
		/// 
		/// </summary>
		public int VoteLimit
		{
			get { return voteLimit; }
			set
			{
				if (value != voteLimit)
				{
					MarkChanged("VoteLimit");
					voteLimit = value;
				}
			}
		}

		private DateTime voteStartTime = DateTime.MinValue;
		/// <summary>
		/// 
		/// </summary>
		public DateTime VoteStartTime
		{
			get { return voteStartTime; }
			set
			{
				if (value != voteStartTime)
				{
					MarkChanged("VoteStartTime");
					voteStartTime = value;
				}
			}
		}

		private String voteTitle = String.Empty;
		/// <summary>
		/// 
		/// </summary>
		public String VoteTitle
		{
			get { return voteTitle; }
			set
			{
				if (value != voteTitle)
				{
					MarkChanged("VoteTitle");
					voteTitle = value;
				}
			}
		}

		#endregion Fields and Properties

		#region Constructors

		public Vote()
		{
		}

		#endregion Constructors

		#region Base overrides

		protected override void ValidationRules()
		{
		}

		protected override Vote DataSelect(int id)
		{
			return Services.DALService.VoteService.Select(id);
		}

		protected override void DataUpdate()
		{
			Services.DALService.VoteService.Update(this);
		}

		protected override void DataInsert()
		{
			Services.DALService.VoteService.Insert(this);
		}

		protected override void DataDelete()
		{
			Services.DALService.VoteService.Delete(this);
		}

		#endregion Base overrides
	}
}
